import request from '@/utils/request'

// 获取员工列表
export function getEmployeesList(params) {
  return request({
    url: '/users',
    params
  })
}

// 获取员工数量
export function getEmployeesTotal() {
  return request({
    url: '/users/count'
  })
}

// 添加员工
export function addEmployee(data) {
  return request({
    url: '/auth/local/register',
    method: 'post',
    data
  })
}

// 根据Id获取员工信息
export function getEmployeeInfoById(id) {
  return request({
    url: `/users/` + id
  })
}

// 编辑员工
export function editEmployeeInfo(data) {
  return request({
    url: `/users/` + data.id,
    method: 'put',
    data
  })
}

// 删除员工
export function delEmployee(id) {
  return request({
    url: '/users/' + id,
    method: 'delete'
  })
}
